package tests.struct;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import struct.Adult;

/**
 *
 * @author Gabrielle DuBois
 */
public class AdultTest {
    private Adult a1;
    private Adult a2;

    private final String a1First = "Oris";
    private final String last = "Pothier";
    private final String a1DOB = "03/03/1963";
    private final String joined = "03/03/2003";
    private final String a1Occup = "Trainer";
    private final String a1Emp = "Gold Gym";
    private final String phone = "920.000.0000";
    private final String a1Email = "oris@email.com";
    private final String notes = "";
    private final String a2First = "Dasiy";
    private final String a2DOB = "04/04/1963";
    private final String a2Occup = "Weaver";
    private final String a2Emp = "Self-Employed";
    private final String a2Email = "dasiy@email.com";
    private final int numAttributes = 10;   //number of attributes that compose an adult object


    @Before
    public void setUp() {
        a1 = new Adult(a1First, last, a1DOB, joined, a1Occup, a1Emp, phone, phone, a1Email, notes);
        a2 = new Adult(a2First, last, a2DOB, joined, a2Occup, a2Emp, phone, phone, a2Email, notes);
    }


    @Test
    public void testGetAttributes() {
        String[] a = (String[]) a1.getAttributes();

        assertTrue( numAttributes == a.length );
        assertTrue( a[0].equalsIgnoreCase(a1First) );
        assertTrue( a[1].equalsIgnoreCase(last) );
        assertTrue( a[2].equalsIgnoreCase(a1DOB) );
        assertTrue( a[3].equalsIgnoreCase(joined) );
        assertTrue( a[4].equalsIgnoreCase(a1Occup) );
        assertTrue( a[5].equalsIgnoreCase(a1Emp) );
        assertTrue( a[6].equalsIgnoreCase(phone) );
        assertTrue( a[7].equalsIgnoreCase(phone) );
        assertTrue( a[8].equalsIgnoreCase(a1Email) );
        assertTrue( a[9].equalsIgnoreCase(notes) );
    }

    @Test
    public void testGetFirstName() {
        String first = a2.getFirstName();

        assertTrue( first.equalsIgnoreCase(a2First) );
    }

    @Test
    public void testGetLastName() {
        String lastName = a2.getLastName();

        assertTrue( lastName.equalsIgnoreCase(last) );
    }

    @Test
    public void testGetDateOfBirth() {
        String dob = a2.getDateOfBirth();

        assertTrue( dob.equalsIgnoreCase(a2DOB) );
    }

}//AdultTest